<template>
  <div>
    <el-form size="small" :inline="true" :model="formData" label-width="60px">
      <el-form-item
        v-for="item in queryConfig"
        :key="item.fieId"
        :label="item.label"
      >
        <el-input
          v-model="formData[item.fieId]"
          :placeholder="item.placeholder"
          clearable
          style="width: 120px"
        />
      </el-form-item>
      <slot name="select"></slot>

      <el-form-item>
        <el-button type="primary" @click="onSearch()"> 查询 </el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script lang="ts" setup>
import { reactive, ref, onMounted, toRefs, defineProps } from "vue";

const props = defineProps({
  queryConfig: Object,
});

const { queryConfig } = toRefs(props);

onMounted(() => {});
const formData = reactive({});

const emits = defineEmits(["clickQuery"]);
const onSearch = () => {
  emits("clickQuery", formData);
};
</script>

<style lang="less" scoped></style>
